﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;

public partial class Auditors_DetailTable : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            string orderid = Request.QueryString["orderid"];
            string company = Request.QueryString["CompanyID"];


            var v = new CompanyBLL().GetCompanyByCompanyid(company);
            Label2.Text = string.Format("<div>{0}</div><div>{1}</div><div>Trial Balance as at 31.12.{2}</div><div>試算表截止值{2}年12月31日</div>", v.ChineseName, v.EnglishName, orderid);

            GridView1.DataSource = new AuditorsBLL().GetCompanyDetailTable(company,orderid);
            GridView1.DataBind();

            if(new AuditorsBLL().GetCompanyProfitLosses(company,orderid)>0)
            {
                Label1.Text = "Net loss for the current / 本期盈利";
            }
            else
            {
                Label1.Text = "Net loss for the period / 本期亏损";
            }




            Label1.Text +=
               string.Format(@"
                 <div>Certified true and correct</div>
                 <div> We have checked the above Trial Balance and confirm that the content reflects</div>
                 <div>truely and fully the transactions of the company for the period stated.</div>
                 <div>我們為 {0}之董事，因上述支出單據遺失，</div>
                 <div>不能提供，現提供上述開支表格，用以做賬，現特此確認以上開支為真實的。</div>
                ",v.EnglishName);
        }
    }
}